import VueRouter from 'vue-router';

//每个页面的容器组件
import homeContainer from './components/tabbar/homeContainer.vue';
import memberContainer from './components/tabbar/memberContainer.vue';
import cartContainer from './components/tabbar/cartContainer.vue';
import searchContainer from './components/tabbar/searchContainer.vue';
import newsContainer from './components/news/newsContainer.vue';
import newsInfo from './components/news/newsInfo.vue';
import photos from './components/photos/photos.vue';
import photosInfo from './components/photos/photosInfo.vue';
import buy from './components/buy/buy.vue';
import buyInfo from './components/buy/buyInfo.vue';
import goodsInfo from './components/buy/goodsInfo.vue';
import goodsComment from './components/buy/goodsComment.vue';

var router = new VueRouter({
    routes: [
        {
            path: '/',
            redirect: '/index'
        },
        {
            path: '/index',
            component: homeContainer,
        },
        {
            path: '/member',
            component: memberContainer
        },
        {
            path: '/cart',
            component: cartContainer
        },
        {
            path: '/search',
            component: searchContainer
        },
        {
            path: '/index/news',
            component: newsContainer
        },
        {
            path: '/index/news/newsinfo/:id',
            component: newsInfo
        },
        {
            path: '/index/photos',
            component: photos
        },
        {
            path: '/index/photos/photosInfo/:id',
            component: photosInfo
        },
        {
            path: '/index/buy',
            component: buy
        },
        {
            path: '/index/buy/buyInfo/:id',
            component: buyInfo
        },
        {
            path: '/index/goodsInfo/:id',
            component: goodsInfo
        },
        {
            path: '/index/goodsComment/:id',
            component: goodsComment
        }
    ],
    linkActiveClass: 'mui-active'
});


export default router;